# -*- coding:utf-8 -*-
import sys
import Ice
Ice.loadSlice('LesComposer.ice')
import LESComposer
from pprint import pprint


class Client(Ice.Application):

    def run(self, args):
        if len(args) > 1:
            print('{0}: too many arguments'.format(self.appName()))
            return 1

        #获得ServiceConfig代理
        service_config_prx = LESComposer.ServiceConfigPrx.checkedCast(
            self.communicator().propertyToProxy('ServiceConfig.Proxy'))
        if not service_config_prx:
            print('Invalid service_config_prx')
            return -1

        service_config = service_config_prx.getServiceConfig()
        pprint(service_config)

        compose_strategy = service_config_prx.getComposeStrategy()
        pprint(compose_strategy)

        return 1


app = Client()
sys.exit(app.main(sys.argv, "config.client"))
